<?php
/**
 * URI相关类
 * @author wangtao
 * @version 1.0
 */
class WT_URI
{
	/**
	 * 解析URI，
	 * 如果是/username/wangtao,返回解析后生成的数组Array([0] => username [1] => wangtao)
	 * @access public
	 * @return array
	 */
	static function explained()
	{
		$uri = mb_convert_encoding($_SERVER['REQUEST_URI'], 'UTF-8', 'GBK');
		$uri = urldecode($uri);
		if (empty($uri)) {
			return array_values($_GET);
		}
		else {
			$uri = substr($uri, 1);
			$arr0 = explode('?', $uri);
			if (empty($arr0[0])) {
				return null;
			}
			else {
				$arr = explode('/', $arr0[0]);
				return $arr;
			}
		}
	}
}